#include <iostream>

struct student
{
    std::string name;
    char gender;
    int age;
};

void change(student *stu)
{
    stu->name = "change";
}

void changeStu(const student *stu)
{
    // stu->name = "changeStu"; // 报错
}

int main()
{

    student stu = {"张三", 'A', 12};
    change(&stu);
    std::cout << "name:\t" << stu.name << std::endl; // name: change

    changeStu(&stu);
    std::cout << "name:\t" << stu.name << std::endl; // name: change
    return 0;
}